package com.eight.cloud.admin.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.eight.cloud.admin.entity.UserEntity;
import com.eight.cloud.mybatisplus.annotation.enums.DataScopeType;
import com.eight.cloud.mybatisplus.datascope.annotation.DataColumn;
import com.eight.cloud.mybatisplus.datascope.annotation.DataScope;
import com.eight.cloud.mybatisplus.mapper.SuperMapper;

/**
 * <p>
 * 用户表 Mapper 接口
 * </p>
 *
 * @author TXC
 * @since 2024-10-02
 */
public interface UserMapper extends SuperMapper<UserEntity> {

    /**
     * 查询用户列表
     * @return
     */
    @DataScope(
            columns = {
                    @DataColumn(column = "dept_id", dataScopeType = DataScopeType.DEPT),
                    @DataColumn(column = "create_by", dataScopeType = DataScopeType.SELF)
            }
    )
    IPage<UserEntity> selectUserList(IPage<UserEntity> page);

    /**
     * 清空表
     */
    void truncate();
}
